package com.example.shopping.service;

import com.example.shopping.dao.IContentDao;
import com.example.shopping.pojo.Content;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/*
Create by 苍狼 于 2020/1/16
站在巅峰看世界，
落在深渊思人生。
*/
@Service
public class ContentServiceImpl implements ContentService {
    @Autowired(required = false)
    private IContentDao contentDao;

    @Override
    public List<Content> selectContentList() {
        return contentDao.selectContentList();
    }

    @Override
    public int deleteContentById(int id) {
        return contentDao.deleteContentById(id);
    }

    @Override
    public int insertContent(Content content) {
        return contentDao.insertContent(content);
    }

    @Override
    public int updateContent(Content content) {
        return contentDao.updateContent(content);
    }

    @Override
    public List<Content> selectContentById(int categoryId) {
        return contentDao.selectContentById(categoryId);
    }

    @Override
    public Content selectContentByIdOne(int id) {
        return contentDao.selectContentByIdOne(id);
    }

    @Override
    public int updateContentStatusClose(int id) {
        return contentDao.updateContentStatusClose(id);
    }

    @Override
    public int updateContentStatusOpen(int id) {
        return contentDao.updateContentStatusOpen(id);
    }
}
